package src.rmi;

import java.rmi.Remote;
import java.rmi.RemoteException;
import java.util.Set;
import src.domain.MailBox;
import src.domain.OutgoingMessage;
import src.domain.PostOffice;
import src.domain.User;




public interface Service extends Remote {

	void saveUser(String name, String userName, String country, String city, String address,String phoneNumber,boolean active)throws RemoteException;
	
	void updateUser(User user)throws RemoteException;
	
	void deleteUser(long idUser)throws RemoteException;
	
	Set<User> getAllUsers()throws RemoteException;
	
	Set<User> getUsers(String name)throws RemoteException;
	
	void savePostOffice(String name, Set<MailBox> mailBoxes,Set<PostOffice> trustOffices)throws RemoteException;
		
	void updatePostOffice(PostOffice postOffice)throws RemoteException;

	void deletePostOffice(long idPostOffice)throws RemoteException;
		
	Set<PostOffice> getAllPostOffices()throws RemoteException;
	
	Set<PostOffice> getPostOffices(String name)throws RemoteException;
	
	Set<PostOffice> getAvailablePostOffices(final PostOffice postOffice) throws RemoteException;

	void saveMailBox(String name, String pass, boolean active, User user,Set<PostOffice> postOffices)throws RemoteException;
	
	void updateMailBox(MailBox mailBox)throws RemoteException;
	
	void deleteMailBox(long idMailBox)throws RemoteException;
	
	Set<MailBox> getAllMailBoxes()throws RemoteException;
	
	Set<PostOffice> getUnassignedPostOffices(Long idMailBox) throws RemoteException;
	
	Set<MailBox> getMailBoxes(String nameMailBox)throws RemoteException;
	
	MailBox getMailBoxByName(String nameMailBox)throws RemoteException;
	
	User getUserByUserName(String userName)throws RemoteException;
	
	PostOffice getPostOfficeByName(String postOfficeName)throws RemoteException;
	
	Set<MailBox> getMailBoxesByPostOffice(long idPostOffice)throws RemoteException;
	
	Set<OutgoingMessage> getOutgoingMessagesByMailBox(long idMailBox)throws RemoteException;
	
	Set<MailBox> getMailBoxesByUser(long idUser)throws RemoteException;
	
}